<?php


$mem = new Memcache();
$mem->connect('127.0.0.1', 11211) or die("连接失败");
//$mem->set('name','张三','0',30);
$val = $mem->get('name');


if($val === false){
    echo '过期了';
    $mem->set('name','李四','0',30);
}
echo $val;